﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using KC.Service.DTO.Constants;

namespace KC.Service.DTO.Extension
{
    public class PaymentExtension
    {
        public static Dictionary<string, string> GetAllPayments()
        {
            var payments = new Dictionary<string, string>();
            payments.Add(ServiceProviderConstants.供应类产品现金支付, "现金");
            payments.Add(ServiceProviderConstants.供应类产品银行承兑汇票支付, "银行承兑汇票");
            payments.Add(ServiceProviderConstants.供应类产品商业承兑汇票支付, "商业承兑汇票");
            payments.Add(ServiceProviderConstants.供应类产品店铺赊销支付, "店铺赊销");
            payments.Add(ServiceProviderConstants.供应类产品银行支付, "银行");
            payments.Add(ServiceProviderConstants.供应类产品商业保理支付, "商业保理");
            payments.Add(ServiceProviderConstants.供应类产品小额贷款支付, "小额贷款");
            payments.Add(ServiceProviderConstants.供应类产品融资租赁支付, "融资租赁");
            payments.Add(ServiceProviderConstants.供应类产品供应链分期支付, "供应链分期");
            payments.Add(ServiceProviderConstants.供应类产品保付代理支付, "保付代理");
            return payments;
        }

        public static Dictionary<string, string> GetAllransactionTypes()
        {
            var payments = new Dictionary<string, string>();
            payments.Add(ServiceProviderConstants.供应类产品现金支付, "直接交易");
            payments.Add(ServiceProviderConstants.供应类产品银行承兑汇票支付, "直接交易");
            payments.Add(ServiceProviderConstants.供应类产品商业承兑汇票支付, "直接交易");
            payments.Add(ServiceProviderConstants.供应类产品店铺赊销支付, "直接交易");
            payments.Add(ServiceProviderConstants.供应类产品银行支付, "融资交易");
            payments.Add(ServiceProviderConstants.供应类产品商业保理支付, "融资交易");
            payments.Add(ServiceProviderConstants.供应类产品小额贷款支付, "融资交易");
            payments.Add(ServiceProviderConstants.供应类产品融资租赁支付, "第三方赊销");
            payments.Add(ServiceProviderConstants.供应类产品供应链分期支付, "第三方赊销");
            payments.Add(ServiceProviderConstants.供应类产品保付代理支付, "融资交易");
            return payments;
        }

        public static string GetPaymentNameByCode(string code)
        {
            var payments = GetAllPayments();
            return payments.ContainsKey(code) ? payments[code] : "";
        }

        public static string GetTransactionTypeByCode(string code)
        {
            var types = GetAllransactionTypes();
            return types.ContainsKey(code) ? types[code] : "";
        }

    }
}
